
 //增加产品

function addProdItems(){
	
	//表头
	var caption="";
	
	$("#pricedatatable").find("thead tr td").each(function(){
			caption+=$(this).text()+";";
	});
	
		//表头
	var captionkey="";
 	$("[name='itemskey']").each(function(){
			captionkey+=$(this).text()+";";
		});
	document.replyform.caption.value=caption;
	document.replyform.captionkey.value=captionkey;
	var options3 = {
				
				 type:'post',
				 dataType:"text",
				 success : function(responseText){
				 	
				 	var responseText_html=responseText.substring(7,responseText.length);
 
					$("#pricedatabody").append(responseText_html);
		 		}
			};
			
			

	
	var url= ebvpContext+"/sourcing/biddingprojlist/addProditem?type="+type+"&pk_areadivision="+area_id+"&oldvalue="+oldareaid+"&is_submit=Y";	
	document.replyform.action=url;
									

	$("#replyform").ajaxSubmit(options3);
 

}

var oldareaid;
var area_id;


//切换区域的提交
function submitByArea(){
	 
	
			var area_title="";
	   
	  	$("#quete_area option").each(function(){
	  			var title=$(this).attr("title");
	  	 	 	
	  	 	 	if($(this).attr("selected")){
	  	 	 		 area_title=title;
	  	 	 	}
	  	 	 
	  			 
	  	});
	  		$("#quete_area").attr("title",area_title);
	 
		
	
	
	
		oldareaid=document.getElementById("old_quete_area").value;
	 	area_id= document.getElementById("quete_area").value;
								
		//当完成时候，
		var pk_suppliers=document.getElementsByName("pk_supplier");
		var 	pk_supplier;
		
		if(pk_suppliers!=null){
			pk_supplier=pk_suppliers[0].value;
		}
 
	//表头
		var caption="";
	
		$("#pricedatatable").find("thead tr td").each(function(){
			caption+=$(this).text()+";";
			 
		});
	
		//表头
		var captionkey="";
		
//	$("#pricedatatable").find("[name='itemskey']").each(function(){
//			 
//			captionkey+=$(this).text()+";";
//			 
//	});

	$("[name='itemskey']").each(function(){
			 
			captionkey+=$(this).text()+";";
			 
	});
	
 
	
	document.replyform.caption.value=caption;
	document.replyform.captionkey.value=captionkey;
	
	 var options2 = {
				
				 type:'post',
				 dataType:"text",
				 success : function(responseText){
				 	
				 	showPriceData(responseText);
					 doCalTotal_Amount();
					checkIfCanEdit(); 
						is_edit=false;
					document.getElementById("old_quete_area").value=area_id; 
				}
				
				
			};
	
	
		var options3 = {
				
				 type:'post',
				 dataType:"text",
				 success : function(responseText){
				 	
				 	showPriceData(responseText);
					 doCalTotal_Amount();
					document.getElementById("old_quete_area").value=area_id;
					is_edit=false;
					$("#Dialog").remove();
					//删除蒙版
				    $(".dialog-widget-overlay").remove(); 
				}
				
				
			};
	
		//加个变量
		var is_submit_success=true;
	
		var option={title : "切换区域提示",

              			content : "您确定要保存报价数据吗？",
              			confirm : function() {
	              		
	              				if(is_start_price=='false'){
									
										showMsg("该环节还没开始投标！");
									 
										showErrorMsg();
										return true;
								}
							if(toAccountSecond <= 0){
								showMsg(getLanMsg("0ec22211-000057"));
							
								showErrorMsg();
								return true;
							 
							}
							if(isDelayCanReply != "true" && isHandlePass == 1){
								showMsg(getLanMsg("0ec22211-000076"));
								
							 
								showErrorMsg();
								return true;
							}
							if(checkQuotePriceInput()){
								//签名
								var bResult = true;
								if (isClientCa == "true") {
									bResult = doVerifyPriceData();
								}
								//提交表单
								if(bResult){
								
									var url= ebvpContext+"/sourcing/biddingprojlist/submitByArea?type="+type+"&pk_areadivision="+area_id+"&oldvalue="+oldareaid+"&is_submit=Y";	
									document.replyform.action=url;
									 
									  
									$("#replyform").ajaxSubmit(options3);
								}
							}else{
							
								 
					 
								showErrorMsg();
								return true;
							
							}
							 
							
              			},
              			 cancel : function() {
              			  		
									document.getElementById('replyform').action =ebvpContext+"/sourcing/biddingprojlist/submitByArea?pk_areadivision="+area_id+"&pkProjStep="+strProjStepPk+"&pkProj="+strProjPk+"&is_submit=N";
						 			
						 			$("#replyform").ajaxSubmit(options3);
						 		 
						         			 
              			 }

              			
				};
	 
 	if(is_edit==true){
 		showConfirmDialog(option);
 	}else{
 	 
		document.getElementById('replyform').action =ebvpContext+"/sourcing/biddingprojlist/submitByArea?pk_areadivision="+area_id+"&pkProjStep="+strProjStepPk+"&pkProj="+strProjPk+"&is_submit=N&pk_supplier="+pk_supplier;
		
		$("#replyform").ajaxSubmit(options2);
	}

 
	
	
}

function showErrorMsg(){
	is_submit_success=false;
	 
	document.getElementById("quete_area").value=oldareaid;
	window.location.hash = "#show_msg";  

}

function exportPriceData(){
	
	//表头
	var caption="";
	
	$("#pricedatatable").find("thead tr td").each(function(){
			caption+=$(this).text()+";";
			 
		});
	
		//表头
	var captionkey="";
	
//	$("#pricedatatable").find("thead tr span").each(function(){
//			captionkey+=$(this).text()+";";
//			 
//	});

		$("[name='itemskey']").each(function(){
					 
					captionkey+=$(this).text()+";";
					 
			});
	
	document.replyform.caption.value=caption;
	document.replyform.captionkey.value=captionkey;
	
	document.replyform.action=ebvpContext+"/sourcing/biddingprojlist/exportPriceData";
	//提交表单
	var options3 = {
		
		type:'post',
		dataType:"text",
		success : function(responseText){
		 	
		}
		
		
	};
	
 
	$('#replyform').submit();
	
}

function importPriceData(){
	
//		if (isClientCa == "true") {
//				var strSn = getSN(strUserCode);
//				if(strSn == null || strSn == ""){
//					showMsg(getLanMsg("0ec22211-000058"));
//					return;
//				}
//			}
//			 
//			//document.getElementById("opinion").value=1;
//			
//			var importpricedata="importpricedata";
//			
//			var url = ebvpContext+"/sourcingcoll/FileUpload_new.jsp";
//			url = url + "?" + "uploadMode=" + type;
//			url = url + "&" + "userCode="+strUserCode;
//			url = url + "&" + "id="+importpricedata;
//			url = url + "&" + "isNeedAddRow=Y";
//			var iTop = (window.screen.availHeight-30-330)/2;
//			var iLeft = (window.screen.availWidth-10-620)/2;
//			window.open(url,'' ,'width=620,height=330,location=no'+',top='+iTop+',left='+iLeft);


				//表头
			var caption="";
			
			$("#pricedatatable").find("thead tr td").each(function(){
					caption+=$(this).text()+";";
					 
				});
			
			 
			var captionkey="";
	
//			$("#pricedatatable").find("thead tr span").each(function(){
//					captionkey+=$(this).text()+";";
//					 
//			});

			$("[name='itemskey']").each(function(){
			 
					captionkey+=$(this).text()+";";
			 
			});
					 
			
			document.replyform.caption.value=caption;
			document.replyform.captionkey.value=captionkey;
		 
		  
		  	
		 	
		  
			var pricedata=	$("#pricedatatable").find("tbody").html();
			
			var pricedata_h =$("#noprodPricedata").html();
			var quete_area="";
			if(document.replyform.quete_area!=null&&""!=document.replyform.quete_area)
				quete_area=document.replyform.quete_area.value;
			 
			var option={title : "导入文件",
				isHtmlContent: true,
    			content : "<form id='importfile' method='post' name='pricedatafileform' enctype='multipart/form-data'>"
    			+"<input type=hidden name='caption' value="+caption+"/><input type=hidden name=captionkey value="+captionkey+"/>"
    			+"<input type=hidden name='pricedata' />"
    			+"<input type=hidden name='pricedata_h' />"
    			+"<input type=hidden name='quete_area' />"
    			+"<input style='width:400px;' name='file' type='file'/></form>",
       			confirm : function() {
       				
       				//	var options={
//       						title:"进行中......"
//       						
//       					};
       				//	showloadingDialog(options);
       				
       				document.pricedatafileform.pricedata.value=pricedata;
       				document.pricedatafileform.pricedata_h.value=pricedata_h;
       				document.pricedatafileform.quete_area.value=quete_area;
       			    importpricedatasubmit1();	
       				   
       			}
				 
              };

		
		 showConfirmDialog(option);
		
 

		
}


function importpricedatasubmit1(){

		 
			
	//
			var status=false;
			 
			
			document.pricedatafileform.action=ebvpContext+"/sourcing/biddingprojlist/importPricedataFile";
			
			var options3 = {
				
				 type:'post',
				 dataType:"text",
				 success : function(responseText){
				 	showPriceData(responseText);
				 	$("#Dialog").remove();
					//删除蒙版
					$(".dialog-widget-overlay").remove();
					 
				}
				
				
			};
			 
		var sfjljl=	$('#importfile').ajaxSubmit(options3);
		 
		 
		 
		 
}

function importpricedatasubmit(pkReleaseFileB,replyFileName,replyFileSize,replyFilePath){

	
			//表头
			var caption="";
			
			$("#pricedatatable").find("thead tr td").each(function(){
					caption+=$(this).text()+";";
					 
				});
			
				//表头
			var captionkey="";
			
			 
			
			$("[name='itemskey']").each(function(){
					captionkey+=$(this).text()+";";
					 
					 
			});
			
			document.replyform.caption.value=caption;
			document.replyform.captionkey.value=captionkey
			
			document.replyform.action=ebvpContext+"/sourcing/biddingprojlist/importPriceData";
			//提交表单
			var options3 = {
				
				type:'post',
				dataType:"text",
				success : function(responseText){
					
				 	showPriceData(responseText);
				}
				
				
			};
			 
			$('#replyform').ajaxSubmit(options3);
	
}

function showPriceData(responseText){
	if(responseText=='')
		return;
	//var pricedata=eval(responseText);
//	
//	var pricedataHtml="";
//	
//	
//	
//	for(var i=0; i<pricedata.length; i++){
//		var pricedatatemp=pricedata[i];
//		
//		var pk_pricetpl_b=pricedatatemp.pk_pricetplt_b;
//		
//		pricedataHtml+="<input type='hidden' name='pk_pricedata_b' value='"+pricedatatemp.pk_pricedata_b+"'/>";
//		
//		pricedataHtml+="<input type='hidden' name='detail_pk_pricetplt_h' value='"+pricedatatemp.pk_pricetplt_h+"'/>";
//		
//			
//		pricedataHtml+="<input type='hidden' name='title_type' value='0'/>";
//			
//		pricedataHtml+="<input type='hidden' name='type_title' value='0'/>";
//			
//		pricedataHtml+="<input class='quote_area' type='hidden' name='quote_area' id='quote_area' value='"+pricedatatemp.quote_area+"'/>";
//		
//	 
//		
//		pricedataHtml+=" <td> ";
//		
//		pricedataHtml+=" <strong id='complate'>";
//		
//		
//		pricedataHtml+=" <input type='hidden' name='prod_fig_src' value='"+pricedatatemp.prod_src+"'/>";
//					
//		pricedataHtml+=" <input type='hidden'  name='prod_name' value='"+pricedatatemp.prod_name+"'/>";
//		
//		pricedataHtml+=pricedatatemp.prod_name;
//		pricedataHtml+=i+"、"+pricedatatemp.config_note;
//		 
//		pricedataHtml+=" </strong>";
//		
//		pricedataHtml+=" <div  style='margin-left:17px;'>";	
//		
//	 pricedataHtml+=" <div  style='margin-left:17px;'>";	
//	 
//	 	pricedataHtml+="<td>"; 
//		
//			pricedataHtml+="   <input type='text' id='has_tax_price' name='has_tax_price' class='textfield pd_2px w_100px h_12px mnytxt'  value='${pricedetail.has_tax_price}' onchange=''setEdit();subReduNum(this,'${PRICE_PRECISION}');doCalPrice('${pricedetail.detail_index}');docal_discount_net_price('${pricedetail.detail_index}',this);' onkeypress='javascript:keyPress(this,event);'/>"	;			        
//			pricedataHtml+=" 	 </td>";
//		
//			
//	}
	
	
	
//	getPriceData_html();
	 
	var responseText_html=responseText.substring(7,responseText.length);
// 
// 	alert(responseText_html);
//  
	$("#pricedatabody").html(responseText_html);
	
	//document.getElementById("pricedatabody").innerHtml=responseText_html;
	
	//$("#pricedatabody").html(showPriceData_Html(pricedata));
	
//	for(var i=0;i<pricedata.length;i++){
//		
//		
//	}
	
}


function  getPriceData_html(){


		var pricedata_html ="<tr class='option 0001AA1000000002MWQ6' id='option'  nujvalue='1' nujian='SVMQ'><input type='hidden' name='pk_pricedata_b' value='0001AA1000000002MWQ6'/><input type='hidden' name='detail_pk_pricetplt_h' value='null'/><input type='hidden' name='pk_pricetplt_b' value='1002AA1000000001ODPA'/><input type='hidden' name='pk_prod' value='1002ZF1000000000KVKA'/><input type='hidden' name='pk_prod_v' value='1002ZF1000000000KVKA'/><input type='hidden' name='pk_prod_cls' value='1002ZF1000000000KVJS'/><input type='hidden' name='pk_prod_unit' value='0001Z0100000000000XT'/><input type='hidden' name='prod_src' value='1'/><input type='hidden' name='amount_precision' value='0'/><input type='hidden' name='row_id' value='1'/><input type='hidden' name='title_type' value='0'/><input type='hidden' name='type_title' value='0'/><input class='quote_area' type='hidden' name='quote_area' id='quote_area' value='null'/> <td>  <input type='hidden' name='prod_fig_src' value='1'/> <input type='hidden'  name='prod_name' value='三星手机电池'/> <strong id='complate'>三星手机电池1、null </strong> <div  style='margin-left:17px;'>编码:&nbsp;null&nbsp;<span style='whidth:10px;'>|规格:&nbsp;11111111111111111111111111111111111111111111111111&nbsp;</span><input type='hidden' name='prod_spec'  value='11111111111111111111111111111111111111111111111111'/><input type='hidden' name='prod_type'  value='null'/><input type='hidden' name='project'  value='null'/><input type='hidden' name='producer'  value='null'/></div>    </td> <td><input type='text'  name=price_def26 class='textfield pd_2px w_100px h_12px'  value='11.0' onchange='setEdit();'/> </td> <td><input type='text'  name=price_def38 class='textfieldnew pd_2px w_100px h_12px datepicker'  value='' onchange='setEdit();'/> </td> <td>&nbsp;&nbsp;100.0&nbsp;&nbsp;&nbsp;&nbsp;	<input type='hidden'   name='amount' class='textfield pd_2px w_100px' style='border-style:none;text-align:right'  value='100.0' readonly/> </td> <td><span style='text-align:center;'>个</span>	<input type='hidden'   name='prod_unit_name' value=个/> </td> <td><input type='text'  name='discount_net_price' class='textfield pd_2px w_100px h_12px mnytxt'  value=30.0 onchange='setEdit();subReduNum(this,2);docal_discount_net_price(1,this);'   onkeypress='javascript:keyPress(this,event);' /> </td> <td>  <span><input type='text'   name='discount_net_sum'  class='textfield pd_2px w_100px color_f73107' style='border-style:none;text-align:right;' readonly value=0.00000000 /></span> </td> <input type='hidden'   name='detail_discount'  value='100' onchange='setEdit();subReduNum(this,2);doCalPrice(1);' onkeypress='javascript:keyPress(this,event);' /> <input type='hidden'   name='tax_rate'  value=17.0 onchange='setEdit();subReduNum(this,2);doCalPrice(1);' onkeypress='javascript:keyPress(this,event);' /> </tr>";

		$("#pricedatabody").html(pricedata_html);
}


function showPriceData_Html(pricedata){

	
	
	return pricedataHtml;

}


function browseFolder(){

	try{
		var Message="";
		
		var Shell=new ActiveXObject("Shell.Application");
		var Folder=Shell.BrowseForFolder(0,Message,0);	
		
		if(Folder!=null){
			 alert(Folder.path);
		
		}
		
	}catch(e){
		alert(e.message);
	}
}
//function docal_discount_net_price(index,obj){
//
//	//计算行号
//		editRow = 0;
//		var rowId = document.getElementsByName("row_id");
//		for(var i=0;i<rowId.length;i++){
//			if(rowId[i].value == index){
//				editRow = i;
//				break;
//			}
//		}
//
//	var innercode_alltemp = document.getElementsByName("innercode");
//	var is_taojian=false;
//	if(innercode_alltemp!=null&&innercode_alltemp[editRow]!=null){
//		
//		is_taojian=docaliscompprod(innercode_alltemp[editRow].value,editRow,obj);
//	}
//	
//		if(!is_taojian){
//			docal_has_tax(editRow,obj.name,obj.value);
//			doCalTotal_Amount();
//		}
//		
//	
//	
//}
//
//
//function docaliscompprod(innercode,editRow,obj){
//		
//		if(obj==null)
//			return false;
//			
//			
//		var row=0;
//		var innercode_all = document.getElementsByName("innercode");
//		//主件的 行数
//		var mainrow=1;
//		var col_name=obj.name;
//		
//		//数量
//		var amountstemp = document.getElementsByName("amount");  
//		
//		var cal_amounts=document.getElementsByName(obj.name);
//		
//		var inner_length=innercode_all.length;
//		//主件的innercode
//		var innercodetemp=innercode.substring(0,4);
//		var amount_total=0;
//		
//		//折后金额（价税合计）
//		var priceTaxSums = document.getElementsByName("discount_net_sum");
//	
//		
//		for(var i=0;i<inner_length;i++){
//			if(innercode_all[i]!=null&&innercode_all[i].value!=""){
//				var innercodeval=innercode_all[i].value;
//			
//				if(innercodeval==innercodetemp)
//					mainrow=i;
//				
//				if(innercodeval.length>4){
//					//所有子件的innercode
//					var innercodevaltemp=innercodeval.substring(0,4);
//					
//					if(innercodevaltemp==innercodetemp){
//						
//						if(cal_amounts!=null&&cal_amounts[i]!=null&&""!=cal_amounts[i].value){
//								var amounts=amountstemp[i].value;
//								var discount_net_sum=0;
//								if(amounts>0){
//									discount_net_sum=parseFloat(cal_amounts[i].value);
//									//给含税金额赋值	
//									priceTaxSums[i].value=discount_net_sum;
//									
//								}
//									
//								else{
//									discount_net_sum=parseFloat(cal_amounts[i].value);
//									//给含税金额赋值	
//									priceTaxSums[i].value="0.0";
//								}
//								amount_total=amount_total+discount_net_sum;
//								subReduNum(priceTaxSums[i],intMnyPrecision);
//								
//						}
//					}
//				
//				}
//					
//					
//			}
//		
//		}
//		//编辑的行和 主件是一行 就跳出
//		if(editRow==mainrow) 
//			return false;
//		
//		
//		var main_amount=amountstemp[mainrow].value==null||0==amountstemp[mainrow].value?1:amountstemp[mainrow].value;
//		var main_price=amount_total/main_amount;
//		
//		cal_amounts[mainrow].value=amount_total;
//		subReduNum(cal_amounts[mainrow],intPricePrecision);
//		
//		docal_has_tax(mainrow,col_name,main_price);
//		docal_has_tax(editRow,col_name,obj.value);
//		
//		doCalTotal_Amount();
//		return true;
//}
////计算含税金额
//function  setHas_tax_amount(i,col_name,objvalue){
//		//数量
//		var amountstemp = document.getElementsByName("amount");  
//		//折后金额（价税合计）
//		var priceTaxSums = document.getElementsByName("discount_net_sum");
//
//		var amounts=amountstemp[i].value;
//		var discount_net_sum=0;
//			if(amounts>0){
//				discount_net_sum=parseFloat(objvalue)*amounts;
//									//给含税金额赋值	
//				priceTaxSums[i].value=discount_net_sum;
//			}
//									
//			else{
//				discount_net_sum=parseFloat(objvalue);
//					//给含税金额赋值	
//				priceTaxSums[i].value="0.0";
//			}
//			 
//			subReduNum(priceTaxSums[i],intMnyPrecision);
//			//doCalTotal_Amount();
//}
//
//
///**
// * 净含税单价 联动套件的时候
// * 重新算下 含税单价
// * @return 
// * @type 
// */
//function docal_has_tax(index,col_name,objvalue){
//
// 
//	if("discount_net_price"!=col_name&&"has_tax_price"!=col_name)
//		return;
//		
//		//折扣率
//	var discountRates = document.getElementsByName("detail_discount");
//	 
//	var discountrate=discountRates[index].value==null||""==discountRates[index].value?"0.0":discountRates[index].value;
//	
//	if("discount_net_price"==col_name){
//			//含税单价
//			var hasTaxPrices = document.getElementsByName("has_tax_price");
//			
//			//净含税单价 = 含税单价*折扣率
//			
//			var hastaxprice=(objvalue/ parseFloat(discountrate))*100;
//			
//			hasTaxPrices[index].value=hastaxprice;
//			subReduNum(hasTaxPrices[index],intPricePrecision);
//			
//			
//			
//	}
//	if("has_tax_price"==col_name){
//			//净含税单价
//			var discount_net_prices = document.getElementsByName("discount_net_price");
//			
//			//净含税单价 = 含税单价*折扣率
//			
//			var discount_net_price=(objvalue* parseFloat(discountrate))/100;
//			
//			discount_net_prices[index].value=discount_net_price;
//			subReduNum(discount_net_prices[index],intPricePrecision);
//	}
//	setHas_tax_amount(index,col_name,objvalue);
//	
//}
//
///**
// * 	重新算一遍 代码有重复
// */
//
//function doCalTotal_Amount(){
//
//	//数量
//	var amounts = document.getElementsByName("amount");  
//	//折后价（含税净价或者无税竞价，统一取含税净价）
//	var hasTaxNetPrices = document.getElementsByName("discount_net_price");
//	
//
//	
//	//折后金额（价税合计）
//	var priceTaxSums = document.getElementsByName("discount_net_sum");
//	
//
//		//更新报价单元合计数据
//	var isProdItem = document.getElementsByName("is_prod_item");
//	var totalAmount = document.getElementsByName("total_amount");
//	var prodTotalAmount = document.getElementsByName("prod_total_amount");
//	var lastTotalAmount = document.getElementsByName("last_total_amount");
//	
//	var innercode_all = document.getElementsByName("innercode");
//	
//	var prodTotalAmountValue = 0;
//	var lastTotalAmountValue = 0;
//	
//		
//	for(var i=0;i<isProdItem.length;i++){
//		if(isProdItem[i].value == "Y"){
//			totalAmount[i].value = "0.00";
//			for(var j=0;j<priceTaxSums.length;j++){
//				//是否是套件
//				var is_main=true;
//				//如果是子件的话就不算总计金额了
//					if(innercode_all!=null&&innercode_all[j]!=null){
//						if(innercode_all[j].value!=null&&innercode_all[j].value.length>4)
//								is_main=false;
//					}
//				
//				if(!is_main)
//					continue;
//				 
//				if(priceTaxSums[j].value==null||"null"==priceTaxSums[j].value||""==priceTaxSums[j].value){
//					priceTaxSums[j].value="0.0";
//					subReduNum(priceTaxSums[j],intMnyPrecision);
//				}
//					
//				
//				if(parseFloat(amounts[j].value) > 0){
//					//数量不为空的情况，则累加金额
//					if(priceTaxSums[j].value != "" && priceTaxSums[j].value != null && priceTaxSums[j].value != "null"){
//						totalAmount[i].value = parseFloat(totalAmount[i].value) + parseFloat(priceTaxSums[j].value);
//					} 
//				}else{
//					//数量为空时，则累加折后含税单价
//					if(hasTaxNetPrices[j].value != "" && hasTaxNetPrices[j].value != null && hasTaxNetPrices[j].value != "null"){
//						totalAmount[i].value = parseFloat(totalAmount[i].value) + parseFloat(hasTaxNetPrices[j].value);
//					} 
//				}
//			}
//			subReduNum(totalAmount[i],intMnyPrecision);
//			prodTotalAmountValue = totalAmount[i].value;
//		}
//		if(totalAmount[i].value != "" && totalAmount[i].value != null && totalAmount[i].value != "null"){
//			lastTotalAmountValue = lastTotalAmountValue + parseFloat(totalAmount[i].value);
//		}
//	}
//	prodTotalAmount[0].value = prodTotalAmountValue;
//	lastTotalAmount[0].value = lastTotalAmountValue;
//	subReduNum(lastTotalAmount[0],intMnyPrecision);
//}
//
//
function doCalLastTotalAmount() {
	//更新报价单元合计数据
	var totalAmount = document.getElementsByName("total_amount");
	var lastTotalAmount = document.getElementsByName("last_total_amount");
	var lastTotalAmountValue = 0;
	for(var i=0;i<totalAmount.length;i++){
		if(totalAmount[i].value != "" && totalAmount[i].value != null && totalAmount[i].value != "null"){
			lastTotalAmountValue = lastTotalAmountValue + parseFloat(totalAmount[i].value);
		}
	}
	lastTotalAmount[0].value = lastTotalAmountValue;
	subReduNum(lastTotalAmount[0],intMnyPrecision);
}
 
